--[[/**
-- * 若敌人攻速低于100%，每降低10%，对该敌人伤害提高5%。
-- * 提升（降低）[0]%伤害 [伤害万分比]
-- *
-- */]]

---@class BuffEffect576100 : BaseBuffEffect
BuffEffect576100 = ClientFight.CreateClass("BuffEffect576100", ClientFight.BaseBuffEffect)
local t = BuffEffect576100

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
     local parameters = {...};
    local result = parameters[3];
    if (not result:isDamage()) then
    return IBuffEffect.FAIL;
    end
    local target =  parameters[1];
    local attackSpeed = FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.ATTACK_SPEED);
    if (attackSpeed > -buff.buffBean.f_BuffEffectValue[1]) then
    return IBuffEffect.FAIL;
    end
    local ratio =  math.abs(attackSpeed)/buff.buffBean.f_BuffEffectValue[1] * buff.buffBean.f_BuffEffectValue[2];
    local damage = calcRatio(result.damage, ratio);
    result.damage = result.damage + damage;
    if (result.damage < 0) then
    result.damage = 0;
    end
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff" .. buff.modelId .. " 总伤害：" .. result.damage .. " 额外附加: " .. damage .. " 伤害加成系数: " .. ratio .. " %%");
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()